@extends('layouts.app')
@section('title',$user->name.'的小屋')
@section('content')
    <div class="row">
    <div class="col-md-4">
        <div class="thumbnail">
            <img src="{{$user->avatar}}" class="img-responsive" alt="..">
            <h4>{{$user->name}}</h4>
            <strong>个人简介</strong>
            <p>{{$user->introduction}}</p>
            <strong>注册于</strong>
            <p>{{$user->created_at->diffForHumans()}}</p>
        </div>
    </div>
    <div class="col-md-8">
        <div class="panel panel-default">
            <div class="panel-body">
                <span>
                    <h1 class="panel-title pull-left" style="font-size:30px;">{{ $user->name }} <small>{{ $user->email }}</small></h1>
                </span>
                </span>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-body">
                <ul class="nav nav-tabs">
                    <li class="{{active_class(if_query('tab',null))}}">
                        <a href="{{route('users.show',$user->id)}}">Ta的话题</a>
                    </li>
                    <li class="{{active_class(if_query('tab','replies'))}}">
                        <a href="{{route('users.show',[$user->id,'tab' => 'replies'])}}">
                            Ta的回复
                        </a>
                    </li>

                </ul>
                @if(if_query('tab','replies'))
                    @include('users._replies',['replies' => $user->replies()->with('topic')->recent()->paginate(5)])
                @else
                    @include('users._topics')
                @endif
            </div>
        </div>
    </div>
    </div>
@stop